#include <cstdio>
#include <iostream>
using namespace std;
#define int long long
#define fread(x) ios::sync_with_stdio(x)
const int nn = 1005;
int n, k ;
int arr[nn];
signed main() {
	fread(0);
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		if (i > 0) {
			arr[i] += arr[i - 1];
		}
	}
	int _max = 0;
	for (int i = 0, j = i + k; i < n && j < n;) {
		_max = max(arr[j]- arr[i],_max);
		i ++,j ++;
	}
	cout << _max;
	return 0;
}
